local que_moqie = fk.CreateSkill {
    name = "que_moqie",
}
Fk:loadTranslationTable {
    ["que_moqie"] = "摸切",
    [":que_moqie"] = "每回合限两次，当你使用或打出一张牌时，若你有“国士”，且记录的数字为奇数，你可以令一名其他角色随机失去一点体力或弃置一张牌；若为偶数，你可以令一名角色随机回复一点体力或摸一张牌。",

    ["$que_moqie1"] = " ",
    ["$que_moqie2"] = " ",
}
local spec = {
    anim_type = "special",
    can_trigger = function(self, event, target, player, data)
        if player:hasSkill(self.name) and target == player and player:getMark("@fuji_guo") > 0 then
            return player:usedSkillTimes(self.name, Player.HistoryPhase) < 2
        end
    end,
    on_cost = function(self, event, target, player, data)
        local room = player.room
        local mark = player:getMark("@fuji_guo")
        local tip = ""
        if mark % 2 == 1 then
            tip = "摸切：请选择一名角色，令其随机弃置一张牌或失去一点体力"
        elseif mark % 2 ~= 1 then
            tip = "摸切：请选择一名角色，令其随机回复一点体力或摸一张牌"
        end
        local to = room:askToChoosePlayers(player, {
            min_num = 1,
            max_num = 1,
            targets = room.alive_players,
            skill_name = que_moqie.name,
            prompt = tip,
            cancelable = true,
        })
        if #to > 0 then
            event:setCostData(self, { tos = to })
            return true
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local mark = player:getMark("@fuji_guo")
        local to = event:getCostData(self).tos[1]
        if mark % 2 == 1 then
            local x = math.random(1, 2)
            if x == 1 then
                if to:isNude() then
                    x = 2
                else
                    local card = table.random(to:getCardIds { Player.Hand, Player.Equip })
                    room:throwCard({ card }, que_moqie.name, to, player)
                end
            end
            if x == 2 then
                room:loseHp(to, 1, que_moqie.name)
            end
        elseif mark % 2 ~= 1 then
            local x = math.random(1, 2)
            if x == 1 then
                if not to:isWounded() then
                    x = 2
                else
                    room:recover({
                        who = to,
                        num = 1,
                        recoverBy = to,
                        skillName = que_moqie.name
                    })
                end
            end
            if x == 2 then
                to:drawCards(1, que_moqie.name)
            end
        end
    end,
}
que_moqie:addEffect(fk.CardUsing, spec)
que_moqie:addEffect(fk.CardResponding, spec)
return que_moqie
